package edu.spex.yjl.week08.home.unit3;

public class Student {
    private int sNO;
    private String sName;
    private String sSex;
    private int sAge;
    private double sJava;

    public Student(){}
    public Student(int sNO,String  sName,String  sSex,int sAge,double sJava){
        this.sNO=sNO;
        this.sName=sName;
        this.sSex=sSex;
        this.sAge=sAge;
        this.sJava=sJava;
    }
    public int getNo(){
        return this.sNO;
    }
    public String getName(){
        return this.sName;
    }
    public String getSex(){
        return this.sSex;
    }
    public int getAge(){
        return this.sAge;
    }
    public double getJava(){
        return this.sJava;
    }
    public static void main(String[] args){

        edu.spex.yjl.week04.Student s1=new edu.spex.yjl.week04.Student(1,"一一","男",20,60);
        edu.spex.yjl.week04.Student s2=new edu.spex.yjl.week04.Student(2,"二二","男",20,61);
        edu.spex.yjl.week04.Student s3=new edu.spex.yjl.week04.Student(3,"三三","男",20,62);
        edu.spex.yjl.week04.Student s4=new edu.spex.yjl.week04.Student(4,"四四","男",20,63);
        edu.spex.yjl.week04.Student s5=new edu.spex.yjl.week04.Student(5,"五五","男",20,64);
        System.out.println("学生的信息");
        System.out.println("学号\t姓名\t性别\t年龄\tjava");
        System.out.println(s1.getNo() +"\t"+s1.getName() +"\t"+s1.getSex()+"\t" +s1.getAge()+"\t"+s1.getJava());
        System.out.println(s2.getNo() +"\t"+s2.getName() +"\t"+s2.getSex()+"\t" +s2.getAge()+"\t"+s2.getJava());
        System.out.println(s3.getNo() +"\t"+s3.getName() +"\t"+s3.getSex()+"\t" +s3.getAge()+"\t"+s3.getJava());
        System.out.println(s4.getNo() +"\t"+s4.getName() +"\t"+s4.getSex()+"\t" +s4.getAge()+"\t"+s4.getJava());
        System.out.println(s5.getNo() +"\t"+s5.getName() +"\t"+s5.getSex()+"\t" +s5.getAge()+"\t"+s5.getJava());
        double avg=(s1.getJava()+s2.getJava()+s3.getJava()+s4.getJava()+s5.getJava())/5;
        System.out.println("java平均成绩"+avg);

        double []javaScore={s1.getJava(),s2.getJava(),s3.getJava(),s4.getJava(),s5.getJava()};
        double max=0,min=0;
        for(int i=0;i<4;i++){
            max=javaScore[0];
            if(max<javaScore[i+1]){
                double temp=max;
                max=javaScore[i+1];
                javaScore[i+1]=temp;
            }
        }
        System.out.println("Java最高分为:"+max);
        for(int i=0;i<4;i++){
            min=javaScore[0];
            if(min>javaScore[i+1]){
                double temp=min;
                min=javaScore[i+1];
                javaScore[i+1]=temp;
            }
        }
        System.out.println("Java最低分为:"+min);

    }
}
